<html>
<head><title>
string testing doc</title>
</head>
<body>
Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.
Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

Generally, the system libraries and frameworks of iOS that ultimately support UIKit are a subset of the libraries and frameworks in Mac OS X. For example, there is no Carbon application environment in iOS, there is no command-line access (the BSD environment in Darwin), there are no printing frameworks and services, and QuickTime is absent from the platform. However, because of the nature of the devices supported by iOS, there are some frameworks, both public and private, that are specific to iOS. 
The following summarizes some of the frameworks found at each layer of the iOS stack, starting from the foundation layer.
	Core OS. This level contains the kernel, the file system, networking infrastructure, security, power management, and a number of device drivers. It also has the libSystem library, which supports the POSIX/BSD 4.4/C99 API specifications and includes system-level APIs for many services.
	Core Services. The frameworks in this layer provide core services, such as string manipulation, collection management, networking, URL utilities, contact management, and preferences. They also provide services based on hardware features of a device, such as the GPS, compass, accelerometer, and gyroscope. Examples of frameworks in this layer are Core Location, Core Motion, and System Configuration. 
This layer includes both Foundation and Core Foundation, frameworks that provide abstractions for common data types such as strings and collections. The Core Frameworks layer also contains Core Data, a framework for object graph management and object persistence.
	Media. The frameworks and services in this layer depend on the Core Services layer and provide graphical and multimedia services to the Cocoa Touch layer. They include Core Graphics, Core Text, OpenGL ES, Core Animation, AVFoundation, Core Audio, and video playback.
	Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd.
The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS:
	UIKit. This framework provides the objects an application displays in its user interface and defines the structure for application behavior, including event handling and drawing. For a description of UIKit 
	Foundation. This framework defines the basic behavior of objects, establishes mechanisms for their management, and provides objects for primitive data types, collections, and operating-system services. Foundation is essentially an object-oriented version of the Core Foundation framework; 
As with Cocoa in Mac OS X, the programmatic interfaces of Cocoa in iOS give your applications access to the capabilities of underlying technologies. Usually there is a Foundation or UIKit method or function that can tap into a lower-level framework to do what you want. But, as with Cocoa in Mac OS X, if you require some capability that is not exposed through a Cocoa API, or if you need some finer control of what happens in your application, you may choose to use an underlying framework directly. For example, UIKit uses the WebKit to draw text and publishes some methods for drawing text; however, you may decide to use Core Text to draw text because that gives you the control you need for text layout and font management. Again, using these lower-level frameworks is not a problem because the programmatic interfaces of most dependent frameworks are written in standard ANSI C, of which the Objective-C language is a superset.
Features of a Cocoa Application
In Mac OS X it is possible to create a Cocoa application without adding a single line of code. You make a new Cocoa application project using Xcode and then build the project. That’s it. Of course, this application won’t do much, or at least much that’s interesting. But this extremely simple application still launches when double-clicked, displays its icon in the Dock, displays its menus and window (titled “Window”), hides itself on command, behaves nicely with other running applications, and quits on command. You can move, resize, minimize, and close the window. You can even print the emptiness contained by the window. 
You can do the same with an iOS application. Create a project in Xcode using one of the project templates, immediately build it, and run it in the iOS Simulator. The application quits when you click the Home button (or press it on a device). To launch the application, click its icon in Simulator. It may even have additional behaviors; for example, with an application made from the Utility Application template, the initial view "flips” to a second view when you click or tap the information (“i”) icon.
Imagine what you could do with a little code. 
In terms of programming effort, Cocoa gives you, the developer, much that is free and much that is low-cost. Of course, to become a productive Cocoa developer means becoming familiar with possibly new concepts, design patterns, programming interfaces, and development tools, and this effort is not negligible. But familiarity yields greater productivity. Programming becomes largely an exercise in assembling the programmatic components that Cocoa provides along with the custom objects and code that define your program’s particular logic, then fitting everything together.
What follows is a short list of how Cocoa adds value to an application with only a little (and sometimes no) effort on your part:
	Basic application framework―Cocoa provides the infrastructure for event-driven behavior and for management of applications, windows, and (in the case of Mac OS X) workspaces. In most cases, you won’t have to handle events directly or send any drawing commands to a rendering library.
	User-interface objects―Cocoa offers a rich collection of ready-made objects for your application’s user interface. Most of these objects are available in the library of Interface Builder, a development application for creating user interfaces; you simply drag an object from the library onto the surface of your interface, configure its attributes, and connect it to other objects. (And, of course, you can always instantiate, configure, and connect these objects programmatically.) 
Here is a sampling of Cocoa user-interface objects:
o	Windows
o	Text fields
o	Image views
o	Date pickers
o	Sheets and dialogs
o	Segmented controls
o	Table views
o	Progress indicators
o	Buttons
o	Sliders
o	Radio buttons (Mac OS X)
o	Color wells (Mac OS X)
o	Drawers (Mac OS X)
o	Page controls (iOS)
o	Navigation bars (iOS)
o	Switch controls (iOS)
Cocoa in Mac OS X also features technologies that support user interfaces, including those that promote accessibility, perform validation, and facilitate the connections between objects in the user interface and custom objects. 
	Drawing and imaging―Cocoa enables efficient drawing of custom views with a framework for locking graphical focus and marking views (or portions of views) as “dirty.” Cocoa includes programmatic tools for drawing Bezier paths, performing affine transforms, compositing images, generating PDF content, and (in Mac OS X) creating various representations of images. 
	System interaction―In Mac OS X, Cocoa gives your application ways to interact with (and use the services of) the file system, the workspace, and other applications. In iOS, Cocoa lets you pass URLs to applications to have them handle the referenced resource (for example, email or websites); it also provides support for managing user interactions with files in the local system and for scheduling local notifications.
	Performance―To enhance the performance of your application, Cocoa provides programmatic support for concurrency, multithreading, lazy loading of resources, memory management, and run-loop manipulation. 
	Internationalization―Cocoa provides a rich architecture for internationalizing applications, making it possible for you to support localized resources such as text, images, and even user interfaces. The Cocoa approach is based on users’ lists of preferred languages and puts localized resources in bundles of the application. Based on the settings it finds, Cocoa automatically selects the localized resource that best matches the user’s preferences. It also provides tools and programmatic interfaces for generating and accessing localized strings. Moreover, text manipulation in Cocoa is based on Unicode by default, and is thus an asset for internationalization.
	Text―In Mac OS X, Cocoa provides a sophisticated text system that allows you to do things with text ranging from the simple (for example, displaying a text view with editable text) to the more complex, such as controlling kerning and ligatures, spell checking, regular expressions, and embedding images in text. Although Cocoa in iOS has no native text system (it uses WebKit for string drawing) and its text capabilities are more limited, it still includes support for spellchecking, regular expressions, and interacting with the text input system.
	Preferences―The user defaults system is based on a systemwide database in which you can store global and application-specific preferences. The procedure for specifying application preferences is different for Mac OS X and iOS.
	Networking―Cocoa also offers programmatic interfaces for communicating with servers using standard Internet protocols, communicating via sockets, and taking advantage of Bonjour, which lets your application publish and discover services on an IP network.
In Mac OS X, Cocoa includes a distributed objects architecture that allows one Cocoa process to communicate with another process on the same computer or on a different one. In iOS, Cocoa supports the capability for servers to push notifications to devices for applications registered to received such notifications.
	Printing―Cocoa on both platforms supports printing. Their printing architecture lets you print images, documents, and other application content along a range of control and sophistication. At the simplest level, you can print the contents of any view or print an image or PDF document with just a little code. At a more complicated level, you can define the content and format of printed content, control how a print job is performed, and do pagination. In Mac OS X, you can add an accessory view to the Print dialog. 
	Undo management―You can register user actions that occur with an undo manager, and it will take care of undoing them (and redoing them) when users choose the appropriate menu items. The manager maintains undo and redo operations on separate stacks. 
	Multimedia―Both platforms programmatically support video and audio. In Mac OS X, Cocoa offers support for QuickTime video.
	Data exchange―Cocoa simplifies the exchange of data within an application and between applications using the copy-paste model. In Mac OS X, Cocoa also supports drag-and-drop models and the sharing of application capabilities through the Services menu. 
Cocoa in Mac OS X has a couple of other features:
	Document-based applications―Cocoa specifies an architecture for applications composed of a potentially unlimited number of documents, with each contained in its own window (a word processor, for example). Indeed, if you choose the “Document-based application” project type in Xcode, many of the components of this sort of application are created for you.
	Scripting― Through application scriptability information and a suite of supporting Cocoa classes, you can make your application scriptable; that is, it can respond to commands emitted by AppleScript scripts. Applications can also execute scripts or use individual Apple events to send commands to, and receive data from, other applications. As a result, every scriptable application can supply services to both users and other applications.

</body>
</html>
